package StudyCode.summary.Basic.numberformat;

import java.util.Date;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CPrintfStyle {
	public static void main(String[] args) {
		System.out.printf("%1$s, %2$s, and %3$s %n", "Hello", "World", "!");
		System.out.printf("%3$s, %2$s, and %1$s %n", "Hello", "World", "!");

		System.out.printf("%1$4d, %2$4d, %3$4d %n", 1, 10, 100);
		System.out.printf("%1$4d, %2$4d, %3$4d %n", 10, 100, 1000);
		System.out.printf("%1$-4d, %2$-4d, %3$-4d %n", 1, 10, 100);
		System.out.printf("%1$-4d, %2$-4d, %3$-4d %n", 10, 100, 1000);

		Date date = new Date();
		System.out.printf("Today is %tD %n", date);
		System.out.printf("Today is %tF %n", date);
		System.out.printf("Today is %tc %n", date);
	}
}
